package com.dq.repository.annex;

import com.dq.domain.annex.AnnexTypeEnum;
import com.dq.domain.annex.MallAnnex;
import com.dq.domain.category.Category;

import com.dq.domain.goods.Goods;
import com.dq.domain.sys.section.SysSection;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/9/17 0017 09:23:35
 */
@Repository
public interface AnnexRepository extends JpaRepository<MallAnnex,Long> {
    List<MallAnnex> findByAnnexTypeEnumAndCategory(AnnexTypeEnum annexTypeEnum, Category category);

    List<MallAnnex> findByAnnexTypeEnumAndSysUser(AnnexTypeEnum annexTypeEnum, SysUser user);

    List<MallAnnex> findByAnnexTypeEnum(AnnexTypeEnum annexTypeEnum);

    List<MallAnnex> findByAnnexTypeEnumAndGoodsAndDeletedFalse(AnnexTypeEnum annexTypeEnum, Goods goods);

    List<MallAnnex> findByOrgAndAnnexTypeEnum(SysSection dept, AnnexTypeEnum annexTypeEnum);

    List<MallAnnex> findAllByIdIn(Long[] ids);
}
